﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="HelloService.Default" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>WCF服务</title>
    <link href="//cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <div class="container message-list">
    </div>
    <script src="//cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script>
        (function ($) {
            var $list = $('.message-list');
            var getMessage = function () {
                $.get('?action=info',
                    {
                        _t: Math.random()
                    },
                    function (json) {
                        if (json && json.length) {
                            for (var i = 0; i < json.length; i++) {
                                $list.append('<div class="message-item">' + json[i] + '</div>');
                            }
                        }
                    });
            };
            var timer = setInterval(function () {
                getMessage();
            }, 2000);
        })(jQuery);
    </script>
</body>
</html>
